﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DreamBuilder.Common;
using ePlanet.ArchiveMange.Services;
using ePlanet.ArchiveMange.DataAccess;
using System.Data;

namespace ePlanet.ArchiveMange.Business
{
    public class BUSZongheVol : BusinessBase, IZongheVolService
    {
        ZongheVolDAL dal = new ZongheVolDAL();
        ArchiveCommon commonDal = new ArchiveCommon();
        #region IZongheVol 成员

        public Models.ArchiveMangeModal.OLISEARCH_ZONGHE_VOLDataTable GetAllZongheVolData()
        {
            return dal.GetAllZongheVolData();
        }

        public Models.ArchiveMangeModal.OLISEARCH_ZONGHE_VOLDataTable GetAllZongheVolDataById(string DATAID)
        {
            return dal.GetAllZongheVolDataById(DATAID);
        }

        public Models.ArchiveMangeModal.OLISEARCH_ZONGHE_VOLDataTable GetAllDocumenArchivetByFilter(string filter)
        {
            return dal.GetAllDocumenArchivetByFilter(filter);
        }

        public System.Data.DataTable GetZongheVolDataByIds(IEnumerable<string> idList)
        {
            return dal.GetZongheVolDataByIds(idList);
        }

        public System.Data.DataTable GetHandoverDataByIds(IEnumerable<string> idList)
        {
            return dal.GetHandoverDataByIds(idList);
        }

        public System.Data.DataTable GetZongheVolDateSpanByIds(IEnumerable<string> idList)
        {
            return dal.GetZongheVolDateSpanByIds(idList);
        }

        public DataTable GetDataIdByArchiveCodeRange(string startCode, string endCode)
        {
            return dal.GetDataIdByArchiveCodeRange(startCode, endCode);
        }

        public Models.ArchiveMangeModal.OLISEARCH_ZONGHE_VOLDataTable GetZongheVolDataByType(string archiveType)
        {
            return  dal.GetZongheVolDataByType(archiveType);

        }

        /// <summary>
        /// 综合类卷内件和其他卷内件保存方式不同
        /// </summary>
        /// <param name="fileIdList"></param>
        /// <param name="DATAID"></param>
        /// <returns></returns>
        public bool SavePageFile(IList<string> fileIdList, string DATAID)
        {
            return dal.SaveZongheVolFile(fileIdList, DATAID);
        }

        /// <summary>
        /// 获取综合类卷内件
        /// </summary>
        /// <param name="DATAID"></param>
        /// <returns></returns>
        public System.Data.DataTable GetPageFileByDATAID(string DATAID)
        {
            return dal.GetZongheVolFileByDATAID(DATAID);
        }

        #endregion

        #region IArchiveBase 成员

        public bool SaveData(System.Data.DataSet ds)
        {
            return commonDal.SaveData(ds);
        }

        public bool SaveAttach(System.Data.DataTable dt_Attach, string objectTableName, string objectID, string DBHelperString)
        {
            return commonDal.SaveAttach(dt_Attach, objectTableName, objectID, DBHelperString);
        }

        public byte[] GetAttachContentByID(string dataID, string DBHelperString)
        {
            return commonDal.GetAttachContentByID(dataID, DBHelperString);
        }

        public System.Data.DataSet GetAttach(string ObjectID, string DBHelperString)
        {
            return commonDal.GetAttach(ObjectID, DBHelperString);
        }

        public bool IsSameSecret(List<Guid> dataIDList)
        {
            return dal.IsSameSecret(dataIDList);
        }

        public bool DeleteData(string key)
        {
            return dal.DeleteData(key);
        }

        #endregion
    }
}
